package com.ruoyi.daily.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.daily.mapper.XinfengCustomerMapper;
import com.ruoyi.daily.domain.XinfengCustomer;
import com.ruoyi.daily.service.IXinfengCustomerService;

/**
 * 客户管理Service业务层处理
 * 
 * @author gyy
 * @date 2025-04-19
 */
@Service
public class XinfengCustomerServiceImpl implements IXinfengCustomerService 
{
    @Autowired
    private XinfengCustomerMapper xinfengCustomerMapper;

    /**
     * 查询客户管理
     * 
     * @param id 客户管理主键
     * @return 客户管理
     */
    @Override
    public XinfengCustomer selectXinfengCustomerById(Long id)
    {
        return xinfengCustomerMapper.selectXinfengCustomerById(id);
    }

    /**
     * 查询客户管理列表
     * 
     * @param xinfengCustomer 客户管理
     * @return 客户管理
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<XinfengCustomer> selectXinfengCustomerList(XinfengCustomer xinfengCustomer)
    {
        return xinfengCustomerMapper.selectXinfengCustomerList(xinfengCustomer);
    }

    /**
     * 新增客户管理
     * 
     * @param xinfengCustomer 客户管理
     * @return 结果
     */
    @Override
    public int insertXinfengCustomer(XinfengCustomer xinfengCustomer)
    {
        xinfengCustomer.setCreateTime(DateUtils.getNowDate());
        return xinfengCustomerMapper.insertXinfengCustomer(xinfengCustomer);
    }

    /**
     * 修改客户管理
     * 
     * @param xinfengCustomer 客户管理
     * @return 结果
     */
    @Override
    public int updateXinfengCustomer(XinfengCustomer xinfengCustomer)
    {
        xinfengCustomer.setUpdateTime(DateUtils.getNowDate());
        return xinfengCustomerMapper.updateXinfengCustomer(xinfengCustomer);
    }

    /**
     * 批量删除客户管理
     * 
     * @param ids 需要删除的客户管理主键
     * @return 结果
     */
    @Override
    public int deleteXinfengCustomerByIds(Long[] ids)
    {
        return xinfengCustomerMapper.deleteXinfengCustomerByIds(ids);
    }

    /**
     * 删除客户管理信息
     * 
     * @param id 客户管理主键
     * @return 结果
     */
    @Override
    public int deleteXinfengCustomerById(Long id)
    {
        return xinfengCustomerMapper.deleteXinfengCustomerById(id);
    }
}
